﻿@model ZhongheCms.Models.GswTblJobCustomer
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section css{

    <link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
    <link rel="stylesheet" href="/Assets/webuploader/webuploader.css" />
    <link href="/Assets/css/select2.css" rel="stylesheet">
    <link href="/Assets/css/select2-bootstrap.css" rel="stylesheet">
    <link rel="stylesheet" href="/Assets/css/datepicker.css" />
}
<div class="row">
    <div class="col-xs-12 col-sm-12 widget-container-col">

        <div class="widget-box">
            <div class="widget-header">
                <h5 class="widget-title">企业会员信息</h5>

                <div class="widget-toolbar">
                </div>
            </div>

            <div class="widget-body">


                <div class="widget-main">


                    @using (Html.BeginForm("Create", "JobCustomer", new { id = Model.Id, ViewBag.m, ViewBag.f, ViewBag.p, ViewBag.fid, ViewBag.keywords }, FormMethod.Post,
    new { name = "myForm", id = "myForm", @class = "form-horizontal", role = "form" }))
                    {

                        <div class="form-group">
                            <label class="control-label no-padding-right col-md-2 col-sm-2" for="CusShortName">企业简称</label>

                            <div class="col-md-4 col-sm-10">
                                <input type="text" id="CusShortName" name="CusShortName" placeholder="" value="@Model.CusShortName" class="form-control" data-val="true" data-val-required="字段不允许为空" />
                                <span class="field-validation-valid help-block" data-valmsg-for="CusShortName" data-valmsg-replace="true"></span>
                            </div>
                            <label class="col-md-2 col-sm-2 control-label no-padding-right" for="Contact">
                                联系人
                            </label>
                            <div class="col-md-4 col-sm-10">
                                <input type="text" id="Contact" name="Contact" class="form-control" value="@Model.Contact" />
                            </div>
                        </div>

                        <div class="hr hr-2 dotted">
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="CustomerName">
                                企业名称
                            </label>
                            <div class="col-sm-10 col-md-10">

                                <input class="form-control" type="text" id="CustomerName" name="CustomerName" value="@Model.CustomerName" />
                            </div>
                        </div>
                        <div class="hr hr-2 dotted">
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="Address">
                                企业地址
                            </label>
                            <div class="col-sm-10 col-md-10">

                                <input class="form-control" type="text" id="Address" name="Address" value="@Model.Address" />
                            </div>
                        </div>
                        <div class="hr hr-2 dotted">
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="Tel">
                                联系电话
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <input class="form-control" type="text" id="Tel" name="Tel" value="@Model.Tel" />
                            </div>
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="Fax">
                                传真
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <input class="form-control" type="text" id="Fax" name="Fax" value="@Model.Fax" />
                            </div>
                        </div>

                        <div class="hr hr-2 dotted">
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="Email">
                                电子邮件
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <input class="form-control" type="text" id="Email" name="Email" value="@Model.Email" />
                            </div>
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="WebUrl">
                                网址
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <input class="form-control" type="text" id="WebUrl" name="WebUrl" value="@Model.WebUrl" />
                            </div>
                        </div>


                        <div class="hr hr-2 dotted">
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="BusinessType">
                                所属行业
                            </label>
                            <div class="col-sm-10 col-md-4">

                                <select name="BusinessType" id="BusinessType" class="form-control">
                                    @if (string.IsNullOrEmpty(Model.BusinessType))
                                    {
                                        <option value="@Model.BusinessType">@Model.BusinessType</option>
                                    }
                                    @foreach (var item in Model.BaseInfos.Where(x => x.FunctionId == 121).OrderBy(x => x.TypeNo))
                                    {
                                        <option value="@item.MasterType">@item.MasterType</option>
                                    }
                                </select>
                            </div>
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="CompanySize">
                                企业规模
                            </label>
                            <div class="col-sm-10 col-md-4">

                                <select name="CompanySize" id="CompanySize" class="form-control">
                                    @if (string.IsNullOrEmpty(Model.CompanySize))
                                    {
                                        <option value="@Model.CompanySize">@Model.CompanySize</option>
                                    }
                                    @foreach (var item in Model.BaseInfos.Where(x => x.FunctionId == 123).OrderBy(x => x.TypeNo))
                                    {
                                        <option value="@item.MasterType">@item.MasterType</option>
                                    }
                                </select>
                            </div>
                        </div>
                        <div class="hr hr-2 dotted">
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="CustomerLogo">
                                企业Logo
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <img width="200" height="100" alt="200x100" id="img" src="@Model.CustomerLogo" />


                                <div class="btns" style="margin-top: 5px">
                                    <div id="picker">
                                        请选择企业Logo上传
                                    </div>

                                </div>
                                <input type="hidden" id="CustomerLogo" name="JobPic" value="@Model.CustomerLogo" />
                            </div>

                        </div>
                        <div class="hr hr-2 dotted">
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="LoginName">
                                用户名
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <input class="form-control" type="text" id="LoginName" name="LoginName" value="@Model.LoginName" />
                            </div>
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="LoginPwd">
                                初始密码
                            </label>
                            <div class="col-sm-10 col-md-4">
                                <input class="form-control" type="password" id="LoginPwd" name="LoginPwd" value="" />
                            </div>
                        </div>
                        <div class="hr hr-2 dotted">
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 col-md-2 control-label no-padding-right" for="CusDescrption">
                                公司简介
                            </label>
                            <div class="col-sm-10 col-md-10">
                                <textarea id="CusDescrption" name="CusDescrption" class="form-control" rows="10">@Model.CusDescrption</textarea>
                            </div>

                        </div>


                        if (ViewBag.scode == "1")
                        {
                            <div class="hr hr-2 dotted"></div>
                            <div class="alert alert-success">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>

                                <strong>
                                    <i class="icon-ok"></i>
                                    提示信息
                                </strong>

                                信息保存成功!

                            </div>
                        }
                        if (ViewBag.scode == "0")
                        {
                            <div class="hr hr-2 dotted"></div>
                            <div class="alert alert-danger">
                                <button type="button" class="close" data-dismiss="alert">
                                    <i class="icon-remove"></i>
                                </button>

                                <strong>
                                    <i class="icon-remove"></i>
                                    错误提示
                                </strong>

                                @Html.ValidationSummary(true)

                            </div>

                        }
                        <div class="clearfix form-actions">
                            <div class="col-md-offset-3 col-md-9">
                                <button class="btn btn-info" type="submit">
                                    &nbsp;&nbsp;<i class="ace-icon fa fa-check bigger-110"></i>
                                    保存&nbsp;&nbsp;
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="button" onclick=" funBack() ">
                                    &nbsp;&nbsp;<i class="ace-icon fa fa-undo bigger-110"></i>
                                    返回&nbsp;&nbsp;
                                </button>
                            </div>
                        </div>


                    }

                </div>



            </div>

        </div>


    </div>


</div>
@section js{
    <script src="/assets/js/jquery.validate.min.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.js"></script>
    <script src="/assets/js/jquery.validate.unobtrusive.bootstrap.js"></script>
    <script src="/assets/js/select2.js"></script>
    <script src="/assets/js/select2_locale_zh-CN.js"></script>
    <script src="/Assets/webuploader/webuploader.js" type="text/javascript"></script>
    <script charset="utf-8" src="/kindeditor/kindeditor-min.js" type="text/javascript"></script>
    <script charset="utf-8" src="/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        KindEditor.ready(function (K) {
            var editor1 = K.create('#CusDescrption', {
                cssPath: '/kindeditor/plugins/code/prettify.css',
                uploadJson: '/kindeditor/upload_json.ashx',
                fileManagerJson: '/kindeditor/file_manager_json.ashx'

            });


        });
        jQuery(function ($) {

            $('#BusinessType,#CompanySize').select2();

            var uploader = WebUploader.create({

                resize: true,


                auto: true,


                swf: '/Assets/webuploader/Uploader.swf',


                server: '/GsnService/UploadFileToQiniu/',


                pick: '#picker'
            });
            uploader.on('uploadAccept', function (file, response) {

                $('#CustomerLogo').val(response.SavePath + response.SaveName);
                $('#img').attr("src", response.SavePath + response.SaveName);
            });

        });

        function funBack() {
            document.location = "/JobCustomer/Index/0?m=@ViewBag.m&f=@ViewBag.f&p=@ViewBag.p&fid=@ViewBag.fid&keywords=@ViewBag.keywords";
        }

    </script>
}